package net.siufung.security.provider.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.siufung.core.model.AbstractDto;
import net.siufung.core.utils.ValidationUtil;
import net.siufung.core.utils.ValidationUtil.ValidResult;

import javax.validation.constraints.NotBlank;

/**
 * @author 陈建峰
 * @since 2022/3/3 4:52 下午
 */
@Slf4j
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
public class PasswdLoginDto extends AbstractDto {

    private static final long serialVersionUID = 1663975360492623528L;
    /**
     * 登录名
     */
    @NotBlank(message = "登录名不能为空！")
    private String loginName;

    /**
     * 登录密码
     */
    @NotBlank(message = "登录密码不能为空！")
    private String loginPasswd;

    /**
     * 租户
     */
    private String tenantId;

    /**
     * 验证码
     */
    private String captcha;

    @Override
    public ValidResult validResult() {
        return ValidationUtil.validateBean(this);
    }
}
